#encoding:utf8
#excute when scrapy finish!

import functools

from handler import dbhandle

from inc.dbmgr import DbMgr
from funcs import get_dbcolt_list
from config.gl import MONGO
from config.gl import DEBUG


def _kanbook():
	if DEBUG:
		return
	else:
		db = DbMgr(MONGO["HOST"], MONGO["PORT"])
		db.use("kankindle")
		collection = db.use_collection("books")

		#down books  
		booklist = get_dbcolt_list(collection)
		dllist = []
		for url in booklist:
			dllist.append(url)
		dlpool = dlmgr.DlMgr(dllist)
		dlpool.start()	


